<template>
<!-- 搜索按钮组 -->
  <div class="button_div">
    <a-button type="primary" icon="search" @click="onSearch()">搜索</a-button>
    <a-button type="primary" icon="sync" style="margin-left:20px;" @click="onReset()">重置</a-button>
    <a-button @click="change" type="link"
      >{{ isOpen ? '收起' : '展开' }}<a-icon :type="isOpen ? 'up' : 'down'"
    /></a-button>
  </div>
</template>
<script>
export default {
  name: 'searchGroupBtn',
  model: {
    prop: 'isOpen',
    event: 'change'
  },
  props: {
    isOpen: {
      type: Boolean,
      default: false
    },
  },
  methods: {
    onSearch() {
      this.$emit('onSearch')
    },
    onReset() {
      this.$emit('onReset')
    },
    change() {
      this.$emit('change', !this.isOpen)
    }
  }
}
</script>
<style lang="less" scoped>
.button_div {
  float: left;
  margin-top: 10px;
}
</style>
